// 获取系统信息
let SYSTEM_INFO = uni.getWindowInfo()

// 状态栏高度
const getstatusBarHeight = ()=> SYSTEM_INFO.statusBarHeight;

// 胶囊按钮高度
const getTitleBarHeight = ()=>{
	if(uni.getMenuButtonBoundingClientRect){
		const {top,height} = uni.getMenuButtonBoundingClientRect()
		return height + (top - getstatusBarHeight())*2
	}
	else {
		return 40;
	}
}

// 状态栏+胶囊按钮高度
const getNavBarHeight = () => getstatusBarHeight() + getTitleBarHeight()


// 底部安全区域
const bottomSafeArea = ()=>{
	const height = uni.getWindowInfo().safeAreaInsets.bottom
	if(height) return height
	else return 10
}

export{getstatusBarHeight,getTitleBarHeight,getNavBarHeight,bottomSafeArea}